package com.app.brilliant.game.service.impl;

import com.app.brilliant.common.service.impl.BaseServiceImpl;
import com.app.brilliant.game.bean.BriPlan;
import com.app.brilliant.game.bean.BriUserPlan;
import com.app.brilliant.game.dto.UserPlanInfoDTO;
import com.app.brilliant.game.service.BriPlanService;
import com.app.brilliant.game.mapper.BriPlanMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;

/**
* @author GF
* @description 针对表【bri_plan】的数据库操作Service实现
* @createDate 2025-08-27 16:08:47
*/
@Service
public class BriPlanServiceImpl extends BaseServiceImpl<BriPlanMapper, BriPlan>
implements BriPlanService{

    @Override
    public BriPlan getFirstPlanByMoney(BigDecimal money) {
        return baseMapper.selectOne(new QueryWrapper<BriPlan>().eq("money", money));
    }
    @Override
    public List<BriPlan> getPlansByMoneyGreaterThan(double minMoney) {
        QueryWrapper<BriPlan> queryWrapper = new QueryWrapper<>();
        queryWrapper.gt("money", minMoney);
        return baseMapper.selectList(queryWrapper);
    }
}
